package com.three.controller;

import java.io.PrintWriter;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.three.entity.SRrecord;
import com.three.entity.Srollcall;
import com.three.entity.User;
import com.three.service.SRrecordService;

@Controller
@RequestMapping("/srrecord")
public class SRrecordController {

	@Autowired
	SRrecordService sRrecordService;
	
	@RequestMapping("/findSRrecords")
	@ResponseBody
	public List<SRrecord> findSRrecords(Integer uid,
			Integer cid) {
		List<SRrecord> sRrecords = sRrecordService.findSRrecords(uid, cid);
		return sRrecords;
	}
	
	@RequestMapping("/findStudentsWithSRrecord")
	@ResponseBody
	public List<User> findStudentsWithSRrecord(Integer cid) {
		List<User> users = sRrecordService.findStudentsWithSRrecord(cid);
		return users;
	}
	
	@RequestMapping("/updateStatus")
	@ResponseBody
	public void updateStatus(Integer ucid,
			Integer status,
			PrintWriter out){
		String result = null;
		out.write(result);
		out.close();
	}
	
}
